package com.fita.admin.service.agent;

import com.demo2do.core.entity.page.Page;
import com.demo2do.core.persistence.support.QueryFilter;
import com.fita.admin.entity.security.Login;
import com.fita.admin.service.DataService;
import com.fita.entity.agent.Agent;
import com.fita.entity.agent.AgentCompany;

import java.util.List;

/**
 * 
 * @author cuteHU
 *
 */
public interface AgentService extends DataService<Agent> {

    /**
     * @param agentCompany
     * @return
     */
    List<Agent> list(AgentCompany agentCompany);

    /**
     * @param class1
     * @return
     */
    int countAgentCompany(Class<AgentCompany> class1);

    /**
     * @param page
     * @return
     */
    List<AgentCompany> listAgentCompany(Page page);

    /**
     * @param clazz
     * @param queryFilter
     * @return
     */
    int countSearch(Class<AgentCompany> clazz, QueryFilter queryFilter);

    /**
     * @param agentCompany
     */
    void updateAgentCompany(AgentCompany agentCompany);

    /**
     * @param agent
     */
    void freezeAgent(Agent agent);

    /**
     * @param agent
     */
    void activateAgent(Agent agent);

    /**
     * @param login
     * @return
     */
    int countAgentCompany(Login login);

    /**
     * @param with
     * @param login
     * @return
     */
    List<AgentCompany> listAgentCompany(Page with, Login login);

    /**
     * @param name
     * @return
     */
    AgentCompany loadByName(String name);

    /**
     * @param id
     * @param agentCompany
     */
    void edit(Long id, AgentCompany agentCompany);

    /**
     * @param agentId
     * @param agent
     */
    void editAgent(Long agentId, Agent agent);

    /**
     * 列出二级代理
     * @param primaryAgentCompanyId
     * @return
     */
    List<Agent> listSecondaryAgent(Long primaryAgentCompanyId);

    /**
     *
     * @param primaryAgentCompany
     * @return
     */
    Agent loadByAgentCompany(AgentCompany primaryAgentCompany);
}
